package com.bjc.platform.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "adm_function")
public class AdmFunction extends BaseObject implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 409451854812042161L;
	private Long id;
	private String url;
	private Long resId;
	
	@Id
	@Column(name = "id", columnDefinition="int")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "res_id", columnDefinition="int")
	public Long getResId() {
		return resId;
	}

	public void setResId(Long resId) {
		this.resId = resId;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder(getClass().getSimpleName());

		sb.append(" [");
		sb.append("id").append("='").append(getId()).append("', ");
		sb.append("url").append("='").append(getUrl()).append("', ");
		sb.append("resId").append("='").append(getResId()).append("'");
		sb.append("]");

		return sb.toString();
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		AdmFunction pojo = (AdmFunction) o;

		if (url != null ? !url.equals(pojo.url)
				: pojo.url != null)
			return false;
		if (resId != null ? !resId.equals(pojo.resId)
				: pojo.resId != null)
			return false;
		

		return true;
	}

	@Override
	public int hashCode() {
		int result = 0;
		result = 31 * result + (id != null ? id.hashCode() : 0);
		result = 31 * result + (url != null ? url.hashCode() : 0);
		result = 31 * result + (resId != null ? resId.hashCode() : 0);

		return result;
	}

}
